﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.ModularFixture.CUiMFConfigurationAdministratorDlg
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using C1.Win.C1FlexGrid;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Resources;
using System.Windows.Forms;
using Tecnomatix.Engineering;
using Tecnomatix.Engineering.Ui;


namespace DnProcessSimulateCommands.ModularFixture;

public class CUiMFConfigurationAdministratorDlg : TxForm
{
  private CUiMFConfigurationsGridWrapper m_grid;
  private CApMFAdministratorManager m_manager;
  private CUiMFIntermediateUnitPlacementPointDlg m_intermediateUnitPlacementPointDlg;
  private CUiMFSetPlacementOriginDlg m_setPlacementOriginDlg;
  private CUiMFVariationsWithPlacementOriginDlg m_variationWithPlacementPointsDlg;
  private CUiMFSetFixtureBasePlacementPointsDlg m_placementPointsDlg;
  private CUiMFLoadConfigurationDlg m_loadConfigurationDlg;
  private CUiMFSelectCompoundResourceDlg m_loadFromCompoundResourceDlg;
  private CUiMFAddPrototypeDlg m_addPrototypeDlg;
  private CUiMFOriginParametersDlg m_originParamsDlg;
  private bool m_disableToolbar;
  private bool m_configurationChanged;
  private IContainer components;
  private ToolBar m_administratorToolbar;
  private ToolBarButton m_setTargetLibraryButton;
  private ToolBarButton m_newConfigurationButton;
  private ToolBarButton m_loadConfigurationButton;
  private ToolBarButton m_addPrototypeButton;
  private ToolBarButton m_addCompoundResourceButton;
  private ToolBarButton m_addVariationButton;
  private ToolBarButton m_deleteRowButton;
  private ToolBarButton m_configurationPropertiesButton;
  private ToolBarButton m_loadCompoundResourceButton;
  private ToolBarButton m_saveConfigurationButton;
  private ToolBarButton m_setOriginParametersButton;
  private ToolBarButton m_setIntermediateUnitPlacementPointButton;
  private ToolBarButton m_setFixtureBasePlacementPointsButton;
  private ToolBarButton m_setPlacementOriginButton;
  private ToolBarButton m_variationsWithPlacementPointButton;
  private ToolBarButton m_displayButton;
  private ToolBarButton m_separator1;
  private ToolBarButton m_separator2;
  private ImageList m_imageList;

  public CUiMFConfigurationAdministratorDlg(ITxCommand command)
  {
    this.InitializeComponent();
    CApMFAdminUtils.InitRegistryManager(command);
    this.m_manager = new CApMFAdministratorManager(this.m_grid);
    CApMFAdminUtils.LoadTargetLibraryFromAppData();
    this.m_grid.SetAdminManager(this.m_manager);
    this.SetToolBarStatus();
    ((Control) this.m_grid).Focus();
  }

  private ResourceManager GetResourceManager()
  {
    if (CApMFAdminUtils.m_resourceManager == null)
      CApMFAdminUtils.m_resourceManager = new ResourceManager("ModularFixture.ConfigurationAdministrator.Res.StringTable", ((object) this).GetType().Assembly);
    return CApMFAdminUtils.m_resourceManager;
  }

  private void CUiMFConfigurationAdministratorDlg_Load(object sender, EventArgs e)
  {
    this.m_grid.Initialize();
    this.m_manager.ConfigurationLoaded += new CApMFAdministratorManager.MFAdministratorManager_LoadConfigurationEventHandler(this.m_manager_ConfigurationLoaded);
    this.m_grid.EnterEditUnitMode += new CUiMFConfigurationsGridWrapper.CUiMFConfigurationsGridWrapper_LoadConfigurationEventHandler(this.m_grid_EnterEditUnitMode);
  }

  private void m_grid_EnterEditUnitMode()
  {
    if (this.m_disableToolbar)
      return;
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void CUiMFConfigurationAdministratorDlg_FormClosing(object sender, FormClosingEventArgs e)
  {
    if (!this.m_manager.IsConfigurationLoaded)
      return;
    if ((this.m_configurationChanged || this.m_grid.ConfigurationChanged) && TxMessageBox.Show(this.GetResourceManager().GetString("SAVE_CONFIGURATION_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      this.SaveConfiguration();
    this.m_manager.DeleteConfigurationResource();
  }

  private void m_manager_ConfigurationLoaded() => this.SetToolBarStatus();

  private void m_administratorToolbar_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
  {
    try
    {
      switch (this.m_administratorToolbar.Buttons.IndexOf(e.Button))
      {
        case 0:
          this.OnSetTargetLibrary();
          break;
        case 2:
          this.OnNewConfiguration();
          break;
        case 3:
          this.OnLoadConfiguration();
          break;
        case 4:
          this.OnSaveConfiguration();
          break;
        case 5:
          this.OnAddPrototype();
          break;
        case 6:
          this.OnAddCompoundResource();
          break;
        case 7:
          this.OnAddVariation();
          break;
        case 8:
          this.OnDeleteRow();
          break;
        case 9:
          this.OnLoadFromCompoundResource();
          break;
        case 10:
          this.OnConfigurationProperties();
          break;
        case 11:
          this.OnDisplay();
          break;
        case 13:
          this.OnSetOriginParameters();
          break;
        case 14:
          this.OnSetPlacementOrigin();
          break;
        case 15:
          this.OnSetIntermediateUnitPlacementPoint();
          break;
        case 16 /*0x10*/:
          this.OnSetFixtureBasePlacementPoints();
          break;
        case 17:
          this.OnVariationWithPlacementPoints();
          break;
      }
    }
    catch (TxException ex)
    {
      int num = (int) MessageBox.Show(((Exception) ex).Message);
    }
  }

  private void OnVariationWithPlacementPoints()
  {
    if ((this.m_configurationChanged || this.m_grid.ConfigurationChanged) && TxMessageBox.Show(this.GetResourceManager().GetString("VARIATIONS_WITH_PLACEMENT_ORIGIN_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      this.SaveConfiguration();
    if (this.m_variationWithPlacementPointsDlg == null)
    {
      this.m_variationWithPlacementPointsDlg = new CUiMFVariationsWithPlacementOriginDlg(this.m_grid.GetGridRow(1).PrototypeId);
      ((Form) this.m_variationWithPlacementPointsDlg).Closed += new EventHandler(this.m_variationWithPlacementPointsDlg_Closed);
      ((Form) this.m_variationWithPlacementPointsDlg).Show((IWin32Window) this);
    }
    else
      ((Control) this.m_variationWithPlacementPointsDlg).Focus();
  }

  private void m_variationWithPlacementPointsDlg_Closed(object sender, EventArgs e)
  {
    this.m_variationWithPlacementPointsDlg = (CUiMFVariationsWithPlacementOriginDlg) null;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnSetPlacementOrigin()
  {
    if (this.m_setPlacementOriginDlg == null)
    {
      this.m_setPlacementOriginDlg = new CUiMFSetPlacementOriginDlg(this.m_grid.GetSelectedGridRow() as CApMFPrototypeGridRow, this.m_grid.GetLocationOfSelectedRowRelativeToRoot());
      ((Form) this.m_setPlacementOriginDlg).Closed += new EventHandler(this.m_setPlacementOriginDlg_Closed);
      ((Form) this.m_setPlacementOriginDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
      this.m_configurationChanged = true;
    }
    else
      ((Control) this.m_setPlacementOriginDlg).Focus();
  }

  private void m_setPlacementOriginDlg_Closed(object sender, EventArgs e)
  {
    this.m_setPlacementOriginDlg = (CUiMFSetPlacementOriginDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnDisplay()
  {
    Cursor current = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;
    TxApplication.ActiveUndoManager.StartTransaction();
    this.m_manager.DeleteConfigurationResource();
    this.m_manager.DisplayConfiguration();
    TxApplication.RefreshDisplay();
    TxApplication.ActiveUndoManager.EndTransaction();
    Cursor.Current = current;
  }

  private void OnSetIntermediateUnitPlacementPoint()
  {
    if (this.m_intermediateUnitPlacementPointDlg == null)
    {
      TxTransformation rowRelativeToRoot = this.m_grid.GetLocationOfSelectedRowRelativeToRoot();
      this.m_intermediateUnitPlacementPointDlg = new CUiMFIntermediateUnitPlacementPointDlg(this.m_grid.GetSelectedGridRow() as CApMFPrototypeGridRow, rowRelativeToRoot);
      ((Form) this.m_intermediateUnitPlacementPointDlg).Closed += new EventHandler(this.m_intermediateUnitPlacementPointDlg_Closed);
      ((Form) this.m_intermediateUnitPlacementPointDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
      this.m_configurationChanged = true;
    }
    else
      ((Control) this.m_intermediateUnitPlacementPointDlg).Focus();
  }

  private void m_intermediateUnitPlacementPointDlg_Closed(object sender, EventArgs e)
  {
    this.m_intermediateUnitPlacementPointDlg = (CUiMFIntermediateUnitPlacementPointDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnAddCompoundResource()
  {
    this.m_grid.AddCompoundResourceNode("CompoundResource");
    this.m_configurationChanged = true;
  }

  private void OnSetFixtureBasePlacementPoints()
  {
    if (this.m_placementPointsDlg == null)
    {
      this.m_placementPointsDlg = new CUiMFSetFixtureBasePlacementPointsDlg((CApMFFixtureBaseTypeData) this.m_manager.ConfigurationData);
      ((Form) this.m_placementPointsDlg).Closed += new EventHandler(this.m_placementPointsDlg_Closed);
      ((Form) this.m_placementPointsDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
    }
    else
      ((Control) this.m_placementPointsDlg).Focus();
  }

  private void m_placementPointsDlg_Closed(object sender, EventArgs e)
  {
    this.m_placementPointsDlg = (CUiMFSetFixtureBasePlacementPointsDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnLoadConfiguration()
  {
    if (this.m_manager.IsConfigurationLoaded && (this.m_configurationChanged || this.m_grid.ConfigurationChanged) && TxMessageBox.Show(this.GetResourceManager().GetString("SAVE_CONFIGURATION_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
      this.SaveConfiguration();
    if (this.m_loadConfigurationDlg == null)
    {
      this.m_loadConfigurationDlg = new CUiMFLoadConfigurationDlg(this.m_manager);
      ((Form) this.m_loadConfigurationDlg).Closed += new EventHandler(this.m_loadConfigurationDlg_Closed);
      ((Form) this.m_loadConfigurationDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
    }
    else
      ((Control) this.m_loadConfigurationDlg).Focus();
    this.m_configurationChanged = false;
    this.m_grid.ConfigurationChanged = false;
  }

  private void m_loadConfigurationDlg_Closed(object sender, EventArgs e)
  {
    this.m_loadConfigurationDlg = (CUiMFLoadConfigurationDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnDeleteRow()
  {
    this.m_grid.RemoveRows(((C1FlexGridBase) this.m_grid).RowSel, true);
    this.m_configurationChanged = true;
  }

  private void OnAddVariation()
  {
    this.m_grid.AddVariationNode();
    this.m_configurationChanged = true;
  }

  private void OnLoadFromCompoundResource()
  {
    if (this.m_loadFromCompoundResourceDlg == null)
    {
      this.m_loadFromCompoundResourceDlg = new CUiMFSelectCompoundResourceDlg(this.m_manager);
      ((Form) this.m_loadFromCompoundResourceDlg).Closed += new EventHandler(this.m_loadFromCompoundResourceDlg_Closed);
      ((Form) this.m_loadFromCompoundResourceDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
    }
    else
      ((Control) this.m_loadFromCompoundResourceDlg).Focus();
    this.m_configurationChanged = true;
  }

  private void m_loadFromCompoundResourceDlg_Closed(object sender, EventArgs e)
  {
    this.m_loadFromCompoundResourceDlg = (CUiMFSelectCompoundResourceDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnConfigurationProperties()
  {
    int num = (int) ((Form) new CUiMFConfigurationPropertiesDlg(this.m_manager, true)).ShowDialog();
  }

  private void OnSetOriginParameters()
  {
    if (this.m_originParamsDlg == null)
    {
      this.m_originParamsDlg = new CUiMFOriginParametersDlg((CApMFConfigurationTypeData) this.m_manager.ConfigurationData);
      ((Form) this.m_originParamsDlg).Closed += new EventHandler(this.m_originParamsDlg_Closed);
      ((Form) this.m_originParamsDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
      this.m_configurationChanged = true;
    }
    else
      ((Control) this.m_originParamsDlg).Focus();
  }

  private void m_originParamsDlg_Closed(object sender, EventArgs e)
  {
    this.m_originParamsDlg = (CUiMFOriginParametersDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnAddPrototype()
  {
    if (this.m_addPrototypeDlg == null)
    {
      this.m_addPrototypeDlg = new CUiMFAddPrototypeDlg(this.m_manager);
      ((Form) this.m_addPrototypeDlg).Closed += new EventHandler(this.m_addPrototypeDlg_Closed);
      ((Form) this.m_addPrototypeDlg).Show((IWin32Window) this);
      this.DisableToolbarButtons();
      this.m_disableToolbar = true;
    }
    else
      ((Control) this.m_addPrototypeDlg).Focus();
    this.m_configurationChanged = true;
  }

  private void m_addPrototypeDlg_Closed(object sender, EventArgs e)
  {
    this.m_addPrototypeDlg = (CUiMFAddPrototypeDlg) null;
    this.m_disableToolbar = false;
    this.SetToolBarStatus();
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void OnNewConfiguration()
  {
    if (this.m_manager.IsConfigurationLoaded && (this.m_configurationChanged || this.m_grid.ConfigurationChanged))
    {
      if (TxMessageBox.Show(this.GetResourceManager().GetString("SAVE_CONFIGURATION_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
        this.SaveConfiguration();
      this.m_manager.DeleteConfigurationResource();
    }
    if (((Form) new CUiMFConfigurationPropertiesDlg(this.m_manager, false)).ShowDialog() != DialogResult.OK)
      return;
    this.m_manager.IsConfigurationLoaded = true;
    this.m_manager.SelectCell(1, 0);
    this.SetToolBarStatus();
    this.m_configurationChanged = false;
    this.m_grid.ConfigurationChanged = false;
  }

  private void OnSaveConfiguration()
  {
    if (CApMFAdminUtils.m_targetLibraryId == 0)
    {
      int num = (int) TxMessageBox.Show(this.GetResourceManager().GetString("TARGET_LIBRARY_NOT_SET_ERROR"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.OK, MessageBoxIcon.Hand);
    }
    else
      this.SaveConfiguration();
  }

  private void SaveConfiguration()
  {
    Cursor current = Cursor.Current;
    Cursor.Current = Cursors.WaitCursor;
    if (this.m_manager.SaveConfiguration())
    {
      int num = (int) TxMessageBox.Show(this.GetResourceManager().GetString("CONFIGURATION_SAVED_SUCCESSFULLY_MESSAGE"), this.GetResourceManager().GetString("CMD_CONFIGURATION_ADMINISTRATOR_NAME"), MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
      this.m_configurationChanged = false;
      this.m_grid.ConfigurationChanged = false;
    }
    Cursor.Current = current;
  }

  private void OnSetTargetLibrary()
  {
    int num = (int) ((Form) new CUiMFAdminSetTargetLibraryDlg()).ShowDialog();
  }

  private void DisableToolbarButtons()
  {
    this.m_setTargetLibraryButton.Enabled = false;
    this.m_newConfigurationButton.Enabled = false;
    this.m_loadConfigurationButton.Enabled = false;
    this.m_addPrototypeButton.Enabled = false;
    this.m_addCompoundResourceButton.Enabled = false;
    this.m_addVariationButton.Enabled = false;
    this.m_deleteRowButton.Enabled = false;
    this.m_configurationPropertiesButton.Enabled = false;
    this.m_displayButton.Enabled = false;
    this.m_loadCompoundResourceButton.Enabled = false;
    this.m_saveConfigurationButton.Enabled = false;
    this.m_setOriginParametersButton.Enabled = false;
    this.m_setPlacementOriginButton.Enabled = false;
    this.m_setIntermediateUnitPlacementPointButton.Enabled = false;
    this.m_setFixtureBasePlacementPointsButton.Enabled = false;
    this.m_variationsWithPlacementPointButton.Enabled = false;
  }

  private void SetToolBarStatus()
  {
    this.m_setTargetLibraryButton.Enabled = true;
    this.m_newConfigurationButton.Enabled = true;
    this.m_loadConfigurationButton.Enabled = true;
    if (!this.m_manager.IsConfigurationLoaded)
    {
      this.m_addPrototypeButton.Enabled = false;
      this.m_loadCompoundResourceButton.Enabled = false;
      this.m_configurationPropertiesButton.Enabled = false;
      this.m_displayButton.Enabled = false;
      this.m_saveConfigurationButton.Enabled = false;
      this.m_addCompoundResourceButton.Enabled = false;
      this.m_addVariationButton.Enabled = false;
      this.m_setIntermediateUnitPlacementPointButton.Enabled = false;
      this.m_setFixtureBasePlacementPointsButton.Enabled = false;
      this.m_deleteRowButton.Enabled = false;
      this.m_setOriginParametersButton.Enabled = false;
      this.m_variationsWithPlacementPointButton.Enabled = false;
      this.m_setPlacementOriginButton.Enabled = false;
    }
    else
    {
      this.m_addPrototypeButton.Enabled = true;
      this.m_loadCompoundResourceButton.Enabled = true;
      this.m_configurationPropertiesButton.Enabled = true;
      this.m_displayButton.Enabled = true;
      this.m_saveConfigurationButton.Enabled = true;
      this.m_addCompoundResourceButton.Enabled = true;
      this.m_addVariationButton.Enabled = true;
      if (this.m_manager.ConfigurationData is CApMFFixtureBaseTypeData)
      {
        this.m_addVariationButton.Enabled = false;
        this.m_setFixtureBasePlacementPointsButton.Enabled = true;
      }
      else
      {
        this.m_addVariationButton.Enabled = true;
        this.m_setFixtureBasePlacementPointsButton.Enabled = false;
      }
      if (!(this.m_manager.ConfigurationData is CApMFConfigurationTypeData))
      {
        this.m_setOriginParametersButton.Enabled = false;
        this.m_variationsWithPlacementPointButton.Enabled = false;
      }
      else
      {
        this.m_setOriginParametersButton.Enabled = true;
        this.m_variationsWithPlacementPointButton.Enabled = true;
      }
    }
  }

  private void m_grid_SelChange(object sender, EventArgs e)
  {
    if (this.m_disableToolbar)
      return;
    this.SetToolBarStatusOnSelectionChanged();
  }

  private void SetToolBarStatusOnSelectionChanged()
  {
    if (this.m_grid.SaveUnitMode)
      return;
    if (this.ShouldAllowAddingNewNode())
    {
      this.m_addPrototypeButton.Enabled = true;
      this.m_addCompoundResourceButton.Enabled = true;
      this.m_loadCompoundResourceButton.Enabled = true;
      this.m_addVariationButton.Enabled = !(this.m_manager.ConfigurationData is CApMFFixtureBaseTypeData);
    }
    else
    {
      this.m_addPrototypeButton.Enabled = false;
      this.m_addVariationButton.Enabled = false;
      this.m_addCompoundResourceButton.Enabled = false;
      this.m_loadCompoundResourceButton.Enabled = false;
    }
    this.m_deleteRowButton.Enabled = this.m_grid.CanDeleteSelectedRow();
    this.m_setIntermediateUnitPlacementPointButton.Enabled = this.m_manager.ConfigurationData is CApMFUnitTypeData && this.m_grid.IsPrototypeNode();
    if (this.m_manager.ConfigurationData is CApMFConfigurationTypeData && this.m_grid.IsPrototypeNode())
      this.m_setPlacementOriginButton.Enabled = true;
    else
      this.m_setPlacementOriginButton.Enabled = false;
  }

  private bool ShouldAllowAddingNewNode()
  {
    bool flag = false;
    if ((this.m_grid.IsCompoundResourceSelected() || this.m_grid.IsVariationSelected()) && this.m_grid.CanAddChildrenToSelectedRow())
      flag = true;
    return flag;
  }

  protected virtual void Dispose(bool disposing)
  {
    if (disposing && this.components != null)
      this.components.Dispose();
    base.Dispose(disposing);
  }

  private void InitializeComponent()
  {
    this.components = (IContainer) new Container();
    ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof (CUiMFConfigurationAdministratorDlg));
    this.m_grid = new CUiMFConfigurationsGridWrapper();
    this.m_administratorToolbar = new ToolBar();
    this.m_setTargetLibraryButton = new ToolBarButton();
    this.m_separator1 = new ToolBarButton();
    this.m_newConfigurationButton = new ToolBarButton();
    this.m_loadConfigurationButton = new ToolBarButton();
    this.m_saveConfigurationButton = new ToolBarButton();
    this.m_addPrototypeButton = new ToolBarButton();
    this.m_addCompoundResourceButton = new ToolBarButton();
    this.m_addVariationButton = new ToolBarButton();
    this.m_deleteRowButton = new ToolBarButton();
    this.m_loadCompoundResourceButton = new ToolBarButton();
    this.m_configurationPropertiesButton = new ToolBarButton();
    this.m_displayButton = new ToolBarButton();
    this.m_separator2 = new ToolBarButton();
    this.m_setOriginParametersButton = new ToolBarButton();
    this.m_setPlacementOriginButton = new ToolBarButton();
    this.m_setIntermediateUnitPlacementPointButton = new ToolBarButton();
    this.m_setFixtureBasePlacementPointsButton = new ToolBarButton();
    this.m_variationsWithPlacementPointButton = new ToolBarButton();
    this.m_imageList = new ImageList(this.components);
    ((ISupportInitialize) this.m_grid).BeginInit();
    ((Control) this).SuspendLayout();
    ((C1FlexGridBase) this.m_grid).AllowDragging = (AllowDraggingEnum) 0;
    componentResourceManager.ApplyResources((object) this.m_grid, "m_grid");
    ((C1FlexGridBase) this.m_grid).AutoClipboard = true;
    ((C1FlexGridBase) this.m_grid).DropMode = (DropModeEnum) 1;
    ((C1FlexGridBase) this.m_grid).ExtendLastCol = true;
    ((C1FlexGridBase) this.m_grid).KeyActionTab = (KeyActionEnum) 2;
    ((Control) this.m_grid).Name = "m_grid";
    ((RowColCollection) ((C1FlexGridBase) this.m_grid).Rows).Count = 1;
    ((C1FlexGridBase) this.m_grid).SelectionMode = (SelectionModeEnum) 1;
    ((C1FlexGridBase) this.m_grid).ShowButtons = (ShowButtonsEnum) 2;
    ((C1FlexGridBase) this.m_grid).StyleInfo = componentResourceManager.GetString("m_grid.StyleInfo");
    ((C1FlexGridBase) this.m_grid).Tree.Column = 0;
    ((C1FlexGridBase) this.m_grid).Tree.LineColor = Color.Black;
    ((C1FlexGridBase) this.m_grid).Tree.Style = (TreeStyleFlags) 11;
    ((C1FlexGridBase) this.m_grid).SelChange += new EventHandler(this.m_grid_SelChange);
    this.m_administratorToolbar.Buttons.AddRange(new ToolBarButton[18]
    {
      this.m_setTargetLibraryButton,
      this.m_separator1,
      this.m_newConfigurationButton,
      this.m_loadConfigurationButton,
      this.m_saveConfigurationButton,
      this.m_addPrototypeButton,
      this.m_addCompoundResourceButton,
      this.m_addVariationButton,
      this.m_deleteRowButton,
      this.m_loadCompoundResourceButton,
      this.m_configurationPropertiesButton,
      this.m_displayButton,
      this.m_separator2,
      this.m_setOriginParametersButton,
      this.m_setPlacementOriginButton,
      this.m_setIntermediateUnitPlacementPointButton,
      this.m_setFixtureBasePlacementPointsButton,
      this.m_variationsWithPlacementPointButton
    });
    componentResourceManager.ApplyResources((object) this.m_administratorToolbar, "m_administratorToolbar");
    this.m_administratorToolbar.ImageList = this.m_imageList;
    this.m_administratorToolbar.Name = "m_administratorToolbar";
    this.m_administratorToolbar.ButtonClick += new ToolBarButtonClickEventHandler(this.m_administratorToolbar_ButtonClick);
    componentResourceManager.ApplyResources((object) this.m_setTargetLibraryButton, "m_setTargetLibraryButton");
    this.m_setTargetLibraryButton.Name = "m_setTargetLibraryButton";
    this.m_separator1.Name = "m_separator1";
    this.m_separator1.Style = ToolBarButtonStyle.Separator;
    componentResourceManager.ApplyResources((object) this.m_newConfigurationButton, "m_newConfigurationButton");
    this.m_newConfigurationButton.Name = "m_newConfigurationButton";
    componentResourceManager.ApplyResources((object) this.m_loadConfigurationButton, "m_loadConfigurationButton");
    this.m_loadConfigurationButton.Name = "m_loadConfigurationButton";
    componentResourceManager.ApplyResources((object) this.m_saveConfigurationButton, "m_saveConfigurationButton");
    this.m_saveConfigurationButton.Name = "m_saveConfigurationButton";
    componentResourceManager.ApplyResources((object) this.m_addPrototypeButton, "m_addPrototypeButton");
    this.m_addPrototypeButton.Name = "m_addPrototypeButton";
    componentResourceManager.ApplyResources((object) this.m_addCompoundResourceButton, "m_addCompoundResourceButton");
    this.m_addCompoundResourceButton.Name = "m_addCompoundResourceButton";
    componentResourceManager.ApplyResources((object) this.m_addVariationButton, "m_addVariationButton");
    this.m_addVariationButton.Name = "m_addVariationButton";
    componentResourceManager.ApplyResources((object) this.m_deleteRowButton, "m_deleteRowButton");
    this.m_deleteRowButton.Name = "m_deleteRowButton";
    componentResourceManager.ApplyResources((object) this.m_loadCompoundResourceButton, "m_loadCompoundResourceButton");
    this.m_loadCompoundResourceButton.Name = "m_loadCompoundResourceButton";
    componentResourceManager.ApplyResources((object) this.m_configurationPropertiesButton, "m_configurationPropertiesButton");
    this.m_configurationPropertiesButton.Name = "m_configurationPropertiesButton";
    componentResourceManager.ApplyResources((object) this.m_displayButton, "m_displayButton");
    this.m_displayButton.Name = "m_displayButton";
    this.m_separator2.Name = "m_separator2";
    this.m_separator2.Style = ToolBarButtonStyle.Separator;
    componentResourceManager.ApplyResources((object) this.m_setOriginParametersButton, "m_setOriginParametersButton");
    this.m_setOriginParametersButton.Name = "m_setOriginParametersButton";
    componentResourceManager.ApplyResources((object) this.m_setPlacementOriginButton, "m_setPlacementOriginButton");
    this.m_setPlacementOriginButton.Name = "m_setPlacementOriginButton";
    componentResourceManager.ApplyResources((object) this.m_setIntermediateUnitPlacementPointButton, "m_setIntermediateUnitPlacementPointButton");
    this.m_setIntermediateUnitPlacementPointButton.Name = "m_setIntermediateUnitPlacementPointButton";
    componentResourceManager.ApplyResources((object) this.m_setFixtureBasePlacementPointsButton, "m_setFixtureBasePlacementPointsButton");
    this.m_setFixtureBasePlacementPointsButton.Name = "m_setFixtureBasePlacementPointsButton";
    componentResourceManager.ApplyResources((object) this.m_variationsWithPlacementPointButton, "m_variationsWithPlacementPointButton");
    this.m_variationsWithPlacementPointButton.Name = "m_variationsWithPlacementPointButton";
    this.m_imageList.ImageStream = (ImageListStreamer) componentResourceManager.GetObject("m_imageList.ImageStream");
    this.m_imageList.TransparentColor = Color.Transparent;
    this.m_imageList.Images.SetKeyName(0, "SearchScope.bmp");
    this.m_imageList.Images.SetKeyName(1, "NewConfiguration.bmp");
    this.m_imageList.Images.SetKeyName(2, "LoadConfiguration.bmp");
    this.m_imageList.Images.SetKeyName(3, "SaveConfiguration.bmp");
    this.m_imageList.Images.SetKeyName(4, "addPrototype.bmp");
    this.m_imageList.Images.SetKeyName(5, "NewCompoundResource.bmp");
    this.m_imageList.Images.SetKeyName(6, "NewVariation2.bmp");
    this.m_imageList.Images.SetKeyName(7, "delete.bmp");
    this.m_imageList.Images.SetKeyName(8, "Properties.bmp");
    this.m_imageList.Images.SetKeyName(9, "SetOriginParameters.ico");
    this.m_imageList.Images.SetKeyName(10, "SetIntermediateUnitPlacementPoint.bmp");
    this.m_imageList.Images.SetKeyName(11, "SetFixtureBasePlacementPoint.bmp");
    this.m_imageList.Images.SetKeyName(12, "loadFromCompoundResource.bmp");
    this.m_imageList.Images.SetKeyName(13, "DisplayFixture.bmp");
    this.m_imageList.Images.SetKeyName(14, "SetPlacementOrigin.ico");
    this.m_imageList.Images.SetKeyName(15, "CheckPlacementOriginForVariations.ico");
    componentResourceManager.ApplyResources((object) this, "$this");
    ((ContainerControl) this).AutoScaleMode = AutoScaleMode.Font;
    ((Control) this).Controls.Add((Control) this.m_administratorToolbar);
    ((Control) this).Controls.Add((Control) this.m_grid);
    ((Control) this).Name = nameof (CUiMFConfigurationAdministratorDlg);
    this.SemiModal = false;
    ((Form) this).ShowIcon = false;
    ((Form) this).Load += new EventHandler(this.CUiMFConfigurationAdministratorDlg_Load);
    ((Form) this).FormClosing += new FormClosingEventHandler(this.CUiMFConfigurationAdministratorDlg_FormClosing);
    ((ISupportInitialize) this.m_grid).EndInit();
    ((Control) this).ResumeLayout(false);
    ((Control) this).PerformLayout();
  }

  private enum EGridToolbarBtns
  {
    SetTargetLibrary,
    Separator1,
    NewConfiguration,
    LoadConfiguration,
    SaveConfiguration,
    AddPrototype,
    AddCompoundResource,
    AddVariation,
    DeleteRow,
    LoadFromCompoundResource,
    ConfigurationProperties,
    Display,
    Separator2,
    SetOriginParameters,
    SetPlacementOrigin,
    SetIntermediateUnitPlacementPoint,
    SetFixtureBasePlacementPoints,
    VariationsWithPlacementPoints,
  }
}
